import os
import random
n = [3, 4, 10, 9, 16, 15, 100, 99, 98, 97]

for i in range(0, 10):
	os.system('echo %d| python mk.py >matrixtree%d.in' % (n[i], i + 1))


os.system('g++ c.cpp -O2 -o c')
for i in range(0, 10):
	os.system('./c <matrixtree%d.in >matrixtree%d.out' % (i + 1, i + 1))
